<?php
class editor_map
{
    public $id;
    public $html;

    function _print($txt)
    {
        $this->html.=$txt;
    }

    function  __construct($id = 0) {
        $this->id = (int)$id;
    }

    function out()
    {
        $this->_print('<!-- map '.$this->id.' -->');
        // рисуем поле

        $this->_print('
        <html><head>
        <link href="/css/css.css" rel="stylesheet" type="text/css"></link>
        <script src="http://world.ljrate.ru/js/jquery.js" type="text/javascript"></script>
        <script type="text/javascript" src="http://world.ljrate.ru/js/scroll.js"></script>
        <script type="text/javascript" src="http://world.ljrate.ru/js/jquery.mousewheel"></script>
        <script type="text/javascript" src="http://world.ljrate.ru/js/jquery.scrollTo-min.js"></script>
        <script src="http://world.ljrate.ru/js/progressbar/jquery.ui.core" type="text/javascript"></script>
        <script src="http://world.ljrate.ru/js/progressbar/jquery.ui.widget" type="text/javascript"></script>
        <script src="http://world.ljrate.ru/js/progressbar/jquery.ui.progressbar" type="text/javascript"></script>

');
        $this->_print('<script src="http://world.ljrate.ru/admin/editor/drawmap_admin.js" type="text/javascript"></script>');

        // выводим данные для поля
        $this->_print("</head>
<body>
<div id='game_container' style='width:900px;height:700px;overflow:hidden'></div>
<style>#grass_holder{width:900px!important;height:700px!important;}</style>");
        // запускаем скрипт
        $this->_print('
<script>
_globals = new Array();
_globals["defines"] = new Array();
_globals["defines"]["STATIC_VERSION"] = "1296553228";
_globals["defines"]["STATIC_URL_IMG"] = "http://world.ljrate.ru/img/";

$(document).ready(function(){
    drawmap();
});
</script>');
        ob_end_clean();
        return $this->html;
    }
}
?>
